import fetch from './request'
/**
 * @param { get  params} 
 * @param { post data} 
 *
 */
export const postLogin = (data) => {
  return fetch.post('/users/login', { ...data })
}

export const getPageData = (params) => {
  return fetch.get('/users/page', {
    params: { ...params }
  })
}

export const postAdd = (data) => {
  return fetch.post(`/users`, { ...data })
}
export const postUpdate = ({ id, ...data }) => {
  return fetch.post(`/users/${id}`, { ...data })
}
export const getSearch = (params) => {
  return fetch.get(`/search`, { params: { ...params } })
}
export const deleteItem = ({ id }) => {
  return fetch.delete(`/delete/${id}`)
}